package org.pplb5.siresto;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class ActivityDaftarMenu extends ListActivity{
	int i = 1;
	 @Override
	    public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        
	        //dummy hardcode
	        String[] values = new String[] { "Menu A", "Menu B", "Menu C",
					"Menu D", "Menu E", "Menu F", "Menu G", "Menu H",
					"Menu I", "Menu J" };
			ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
					R.layout.daftarmenu_view,R.id.menu_name, values);
			
	       // Intent i = getIntent();
	       // final String namaResto = i.getStringExtra("NAMA_RESTO");
	        //txtProduct.setText(namaResto);
			
      setListAdapter(adapter);
	        
	 
	    }
		@Override
		public void onListItemClick(ListView l, View v, int position, long id) {
			String item = (String) getListAdapter().getItem(position);

			Intent i = getIntent();
	        String namaResto = i.getStringExtra("NAMA_RESTO");
	        Toast.makeText(this, item + " dari "+namaResto, Toast.LENGTH_SHORT).show();
		}
}
